package com.cxso.example.client;

import com.cxso.example.enums.ProductClientEnum;
import com.cxso.example.request.cgss.EnterpriseCheckRequest;
import com.cxso.example.request.cgss.StaffInfoVerificationRequest;
import com.cxso.example.request.cgss.VehicleVerificationRequest;
import com.cxso.example.response.cgss.EnterpriseCheckResponse;
import com.cxso.example.response.cgss.StaffInfoVerificationResponse;
import com.cxso.example.response.cgss.VehicleVerificationResponse;
import com.cxso.example.sdk.domain.Result;
import com.cxso.example.sdk.http.base.HttpMethod;
import com.cxso.example.sdk.http.client.Client;
import com.cxso.example.sdk.http.core.ChoiceClient;
import io.swagger.v3.oas.annotations.media.Schema;

@Schema(description = "信息核验")
public class CgssClient extends Client {

    public CgssClient(ChoiceClient choiceClient) {
        super(choiceClient);
    }

    @Schema(description = "驾驶员从业资格证核验")
    public Result<StaffInfoVerificationResponse> staffInfoVerification(StaffInfoVerificationRequest req) {
        return choiceClient.choice(ProductClientEnum.SHARE_PC.getCode()).execute("/v4/api/cgss/operateStaffInfoVerification", HttpMethod.POST, req).toEntity(StaffInfoVerificationResponse.class);
    }

    @Schema(description = "车辆道路运输证核验")
    public Result<VehicleVerificationResponse> vehicleVerification(VehicleVerificationRequest req) {
        return choiceClient.choice(ProductClientEnum.SHARE_PC.getCode()).execute("/v4/api/cgss/operateVehicleVerification", HttpMethod.POST, req).toEntity(VehicleVerificationResponse.class);
    }

    @Schema(description = "企业基础信息核验")
    public Result<EnterpriseCheckResponse> enterpriseCheck(EnterpriseCheckRequest req) {
        return choiceClient.choice(ProductClientEnum.SHARE_PC.getCode()).execute("/v4/api/cgss/operateEnterpriseCheck", HttpMethod.POST, req).toEntity(EnterpriseCheckResponse.class);
    }
}
